<?php
    error_reporting(E_ALL ^ E_NOTICE);
    cria_variaveis($_POST, $_GET, $_FILES);
    require_once("./classes/upload.php");
?>
<p class="titulo" align="center"><?php echo $msg->get('GAUSS_MSG_02') ?></p>
<p class="subtitulo" align="center"><?php echo $msg->get('GAUSS_MSG_03b') ?></p>
<p>
<div class="tabbar">
    <ul>
    <li><a href="index.php?inc=gauss2.php&modo=material"<?php if ($_SESSION['ANAWEB']->RetornaModoExecucao() == "material") echo " class=\"tabact\""; ?>><?php echo $msg->get('Material_Teorico') ?></a></li>
    <li><a href="index.php?inc=gauss2.php&modo=exemplo"<?php if ($_SESSION['ANAWEB']->RetornaModoExecucao() == "exemplo") echo " class=\"tabact\""; ?>><?php echo $msg->get('Exemplos_Prontos') ?></a></li>
    <li><a href="index.php?inc=gauss2.php&modo=teclado"<?php if ($_SESSION['ANAWEB']->RetornaModoExecucao() == "teclado") echo " class=\"tabact\""; ?>><?php echo $msg->get('Entrada_Teclado') ?></a></li>
    </ul>
</div>
<div id="cas">
<?php
    if (!isset($Calcular))
    {
        if ($_SESSION['ANAWEB']->RetornaModoExecucao() == "material")
        {
            $uploads = new Upload();
            $uploads->Lista("sistemas");
        }
        else if ($_SESSION['ANAWEB']->RetornaModoExecucao() == "exemplo")
        {
            include "exibe_prob_sela_gauss2_xml.php"; // exibe menu de exemplos contidos na biblioteca de exemplos em xml
        }
        else if ($_SESSION['ANAWEB']->RetornaModoExecucao() == "teclado")
        {
            if ((strlen($dim) == 0) | ($dim <= 0))
            {
                echo "<form method=post enctype=multipart/form-data action=index.php?inc=gauss2.php&modo=teclado>";
                echo $msg->get('GAUSS_MSG_04');
                echo "<input type=text size='2' maxlength='2' name=dim value=".($dim).">";
                echo "<br><br>";
                echo "<input type=hidden name=executar value=sim>";
                echo "<input class=button type=submit name=Submit value=".$msg->get('G_MSG_02').">";
                echo "</form>";
                echo "<form action=index.php?opcao=gauss2 method=post>";
                echo "<input class=button type=submit name=Submit value=".$msg->get('G_MSG_03').">";
                echo "</form>";
            }
            elseif (!checaNumerico($dim))
            {
?>
                <p><font color="red"><?php echo $msg->get('Apenas_Dados_Numericos') ?></font></p>
                <p><input type="button" value="<?php echo $msg->get('Voltar') ?>" onclick="history.back()" class="button"></p>
<?php
            }
            else
            {
                echo "<form method=post enctype=multipart/form-data action=index.php?inc=gauss2.php&modo=teclado>";
                //echo GAUSS_MSG_04;
                echo "<input type=hidden name=dim value=".($dim).">";
                echo "<p align=left><font face=Arial>".$msg->get('GAUSS_MSG_05')."</font>";
                echo "<nobr>";
                for ($i = 0; $i < $dim; $i++)
                {
                    echo "<br><br>";
                    for ($j = 0; $j < $dim; $j++)
                    {
                        $aux = $j+1;
                        echo "<input type=text maxlength=10 size=5 name=A[".($i)."][".($j)."] value=".($A[$i][$j])."> X <sub> ".($aux)." </sub>";
                        if ($j < ($dim-1))
                        {
                            echo " + ";
                        } //end if
                    } //end for j
                    echo " = ";
                    echo "<input type=text maxlength=10 size=5 name=A[".($i)."][".($j)."] value=".($A[$i][$j]).">";
                } //end for i
                echo "</nobr>";
                echo "<p>";

                echo "<input class=button type=submit name=Calcular value=".$msg->get('G_MSG_04').">";
                echo "<br>";
                echo "</form>";
                echo "<form method=post enctype=multipart/form-data action=index.php?inc=gauss2.php>";
                echo "<input class=button type=submit name=Submit value=".$msg->get('G_MSG_03').">";
                echo "</form>";
            } //end if
            echo "</body>";
        }
    }
    else
    {
        // armazena os dados do problema para serem resolvidos por outros metodos
        for ($i = 0; $i < $dim; $i++)
        {
            for ($j = 0; $j < $dim; $j++)
            {
                $Atemp[$i][$j] = $A[$i][$j];
            } //end for j
            $Atemp[$i][$j] = $A[$i][$j];
        } //end for i
        if ($modo != "teclado")
            verificaBib($xml_file);
        if (!checaNumerico($dim) || !checaNumerico($A))
        {
?>
                <p><font color="red"><?php echo $msg->get('Apenas_Dados_Numericos') ?></font></p>
                <p><input type="button" value="<?php echo $msg->get('Voltar') ?>" onclick="history.back()" class="button"></p>
<?php
        }
        else
        {
            echo "<br><b>".$msg->get('GAUSS_MSG_04')."</b> $dim";
            // echo "<input type=text size='2' maxlength='2' name=dim value=".($dim).">";
            echo "<br>";
            echo "<p align=left><font face=Arial><b>".$msg->get('GAUSS_MSG_05')."</b></font>";
            echo "<table border=\"0\">";
            for ($i = 0; $i < $dim; $i++)
            {
                echo "<tr>\n";
                for ($j = 0; $j < $dim; $j++)
                {
                    $aux = $j+1;
                    if ($j > 0)
                    {
                        echo "<td valign=\"top\" align=\"center\" width=\"20\"> + </td>";
                    } //end ifj
                    echo "<td align=\"right\" valign=\"top\">".$A[$i][$j]."</td>";
                    echo "<td align=\"right\" valign=\"top\">x<sub>".$aux."</sub></td>";
                } //end forj
                echo "<td valign=\"top\" align=\"center\" width=\"20\"> = </td>";
                echo "<td valign=\"top\" align=\"right\">".$A[$i][$dim]."</td>";
                echo "\n</tr>\n";
            } //end fori
            echo "</table>";
            echo "<!Matriz Equivalente>";
            echo "<p align=left><font face=Arial><b>".$msg->get('GAUSS_MSG_07')."</b></font>";
            //echo "<nobr>";
            echo "<table border=\"0\">";
            for ($i = 0; $i < $dim; $i++)
            {
                //echo "<br>";
                echo "<tr>";
                for ($j = 0; $j <= $dim; $j++)
                {
                    //echo "<input type=text name=A[".($i)."][".($j)."] value=".($A[$i][$j])." maxlength=10 size=5>";
                    echo "<td valign=\"top\" align=\"center\" width=\"50\">".($A[$i][$j])."</td>";
                } //end for j
                echo "</tr>";
            } //end for i
            echo "</table>";
            //echo "</nobr>";
            /************************************************** triangularizacao ********************************************************************/
            function triang()
            {
                
                global $A, $dim,$msg;
                $indice = "";
                echo "<br><p align=left><font face=Arial><b>".$msg->get('GAUSS_MSG_08')."</b></font>";
    
                /*** Copia a Matriz A para uma Matriz B ***/
                for ($i = 0; $i < $dim; $i++)
                {
                    for ($j = 0; $j < $dim; $j++)
                    {
                        $B[$i][$j] = $A[$i][$j];
                    } //end for j
                    $B[$i][$j] = $A[$i][$j];
                } //end for i
                /*** Fim copia  ***************************/
    
                for ($k = 0; $k < $dim-1; $k++)
                {
                    /*** Troca de linhas, caso exista algum elemento de valor absoluto
                        abaixo da diagonal principal na mesma coluna da diagonal principal ****/
                    $maior = abs($A[$k][$k]);
            $indice = $k;
                    
                    /*** Verificando o valor absoluto dos elementos abaixo da diagonal ***/
                    for ($cont = $k+1; $cont < $dim; $cont++)
                    {
                        if (abs($A[$cont][$k]) > $maior)
                        {
                            $maior = abs($A[$cont][$k]);
                            $indice = $cont;
                        }
                    }
    
                    /*** Troca das linha ***/
                    $aux2 = $k+1;
                    echo "<p align=left>".$msg->get('GAUSS_MSG_11')." $aux2</p>";
                    if ($k == $dim -2) echo "<br><b>".$msg->get('GAUSS_MSG_12')."</b>";
    
            if ($indice != $k) {
                for ($l = 0; $l <= $dim; $l++)
                {
                    //troca de linha
                    $aux2 = $A[$k][$l];
                    @$A[$k][$l] = $A[$indice][$l];
                    $A[$indice][$l] = $aux2;
                }
                echo "<p align=\"left\">".$msg->get("Matriz_Resultante_Troca")." ".($k+1)." ".$msg->get("Pela_Linha")." ".($indice+1).":</p>";
                echo "<table>";
                for ($i = 0; $i < $dim; $i++)
                {
                    echo "<tr>";
                    for ($j = 0; $j <= $dim; $j++)
                    {
                        echo "<td width=\"50\" align=\"center\">".$A[$i][$j]."</td>";
                    }
                    echo "</tr>";
                }
                echo "</table>";
            }
                    /*** Fim da troca ***/
    
            /*** Zerando elementos abaixo da diagonal principal ***/
                    for ($i = $k+1; $i < $dim; $i++)
                    {
                        @$M[$i][$k] = -$A[$i][$k]/$A[$k][$k];
                        for ($j = 0; $j < $dim+1; $j++)
                $A[$i][$j] += $M[$i][$k] * $A[$k][$j];
                    } // end fori
            /*** Fim Zerando elementos abaixo da diagonal principal ***/
    
                    $aux2 = $k+1;
                    echo "<br>";
                    echo "<p align=\"left\">".$msg->get("Zerando_Elementos")." ".($k+1)." ".$msg->get("Abaixo_Diagonal").":</p>";
                    echo "<table border=\"0\">";
                    for ($i = 0; $i < $dim; $i++)
                    {
                        $aux = $i+1;
                        echo "<tr>";
                        for ($j = 0; $j <= $dim; $j++)
                        {
                            echo "<td align=\"center\" valign=\"top\" width=\"50\">".round($A[$i][$j], 4)."</td>";
                        } //end for j2
                        if ($i < $k+1) echo "<td>&nbsp;</td>";
                        else
                        {
                            echo "<td><font face=Arial>L<sub><font size=1> ".($aux)." </font></sub> = L<sub><font size=1> ".($aux)."";
                            echo "</font></sub> - [(a<sub><font size=1> $aux$aux2 </font></sub>/a<sub><font size=1> $aux2$aux2)";
                            echo "</font></sub> * L<sub><font size=1> $aux2 </font></sub>]</font>";
                            if (($troca != "nao") and ($i == $k) )
                            {
                                echo "<font face=Arial>L<sub><font size=1>".($k+1)."</font></sub>".$msg->get('GAUSS_MSG_17')."L<sub><font size=1>".($troca)."</font></sub>";
                            }
                            echo "</td>";
                        } //end if
                        echo "</tr>";
                    } //end for i2
                    echo "</table>";
                } // end fork
                echo "</nobr><br>";
                echo "<br><br>";
                echo "<p align=left><font face=Arial><b>".$msg->get('GAUSS_MSG_13')."</b></font>";
                echo "<table border=\"0\">";
                for ($i = 0; $i < $dim; $i++)
                {
                    echo "<tr>\n";
                    for ($j = 0; $j < $dim; $j++)
                    {
                        $aux = $j+1;
                        if ($j > 0)
                        {
                            echo "<td valign=\"top\" align=\"center\" width=\"20\"> + </td>";
                        } //end ifj
                        echo "<td align=\"right\" valign=\"top\">".round($A[$i][$j], 4)."</td>";
                        echo "<td align=\"right\" valign=\"top\">x<sub>".$aux."</sub></td>";
                    } //end forj
                    echo "<td valign=\"top\" align=\"center\" width=\"20\"> = </td>";
                    echo "<td valign=\"top\" align=\"right\">".round($A[$i][$dim], 4)."</td>";
                    echo "\n</tr>\n";
                } //end fori
                echo "</table>";
                return "nao";
            } //end triang
            /******************************************************** retrosubstituicao *************************************************************/
            
            function retrosubs($B)
            {
                global $dim, $VetX, $exibir_resultado,$msg;
                            for ($k = $dim-1; $k >= 0; $k--)
                {
                    $VetX[$k] = $B[$k][$dim];
                    for ($i = $k+1; $i < $dim; $i++)
                    {
                        //linha 240
                        $VetX[$k] -= $B[$k][$i] * $VetX[$i];
                    } // end for
                    if ($B[$k][$k] == 0)
                    {
                        // pivo se anulou
                        if ($VetX[$k] == 0)
                        {
                            // infinitas solucoes (0 x = 0)
                            echo $msg->get('GAUSS_MSG_19');
                            $VetX[$k] = 1;
                        }
                        else
                        {
                            // nao possui solucao (0 x = a)
                            echo $msg->get('GAUSS_MSG_20');
                            $exibir_resultado = "nao";
                            break;
                        }
                    }
                    else
                    {
                        // possui nica solucao
                        $VetX[$k] /= $B[$k][$k];
                    }
                } // end for1
                
                if ($exibir_resultado != "nao")
                {
                    /***explicitacao das operacoes da retrosubstituicao***/
                    echo "<p align=left><font face=Arial><b>".$msg->get('GAUSS_MSG_14')."</b></font>";
                    echo "<br><nobr>";
                    echo "".($B[$dim-1][$dim-1])." x <sub> ".($dim)." </sub> = ".($B[$dim-1][$dim])."";
                    if ($B[$dim-1][$dim-1] == 0 )
                    {
                        if ($B[$dim-1][$dim] == 0 )
                        {
                            //sistema tem infinitas solucoes
                            echo "&nbsp <font face=Arial><b> => </b></font>&nbsp x <sub> ".($dim)." </sub> = ".($VetX[$dim-1])."";
                            $VetX[$dim-1] = 1;
                        }
                    }
                    else
                    {
                        echo "&nbsp <font face=Arial><b> => </b></font>&nbsp x <sub> ".($dim)." </sub> = ".($B[$dim-1][$dim]/$B[$dim-1][$dim-1])."";
                    }
                    echo "<br>";
                    for ($k = $dim-2; $k >= 0; $k--)
                    {
                        echo "".($B[$k][$k])." x <sub> ".($k+1)."</sub>";
                        for ($i = $k+1; $i < $dim; $i++)
                        {
                            $aux = $B[$k][$i] * $VetX[$i];
                            if ($i > 0)
                            {
                                if ($aux > 0)
                                {
                                    echo (" + ");
                                } //end ifaux
                            } //end ifi
                            if ($aux != 0)
                            {
                                echo $aux;
                            } //end if
                        } //end fori
                        echo (" = ");
                        echo $B[$k][$dim];
                        echo "&nbsp <font face=Arial><b> => </b></font>&nbsp x <sub>";
                        echo "".($k+1)." </sub> = ".($VetX[$k])."<br>";
                    } //end fork
                    echo "</nobr>";
                }
                // end if exibir_resultado
            } // end retrosub
            /****************************************************************************************************************************************/
            $parar = triang();
            if (isset($parar) && $parar != "sim")
            {
                retrosubs($A);
                if ($exibir_resultado != "nao")
                {
                    echo "<p align=left><font face=Arial><b>".$msg->get('GAUSS_MSG_15')."</b></font>";
                    echo "<br>";
                    echo "x = (";
                    for ($i = 0; $i < $dim; $i++)
                    {
                        echo $VetX[$i];
                        if ($i != $dim-1)
                        {
                            echo ",";
                        }
                        echo "<input type=hidden name=VetX[".($i)."] maxlength=10 size=5 value=".($VetX[$i]).">";
                    } //end fori
                    echo ") <sup>T</sup>";
                    for ($i = 0; $i < $dim; $i++)
                    $T[$i] = $Atemp[$i][$dim];
                    seqlsol($Atemp, $VetX, $dim, $T);
                    echo "<p>";
                }
                // end if exibir_resultado
                if (@$correcao == "sim")
                {
                    echo "<br>";
                    echo "<font face=Arial><b>".$msg->get('GAUSS_MSG_16')."</b></font>";
                    echo "<br>";
                    echo "x = (";
                    for ($i = 0; $i < $dim; $i++)
                    {
                        echo $vet_resp[$i];
                        if ($i != $dim-1)
                        {
                            echo ",";
                        }
                        echo "<input type=hidden name=vet_resp[".($i)."] maxlength=10 size=5 value=".($vet_resp[$i]).">";
                    } //end fori
                    echo ") <sup>T</sup>";
                } // end if
            } // end if $parar != sim;
            echo "<p>";
            if (isset($arquivo) && $arquivo == "bancodados")
            {
                // menu de navegacao de exemplos no modulo de banco de dados
                echo "<p>";
                define ("num_exemplos", 10); //Define o numero de exemplos disponiveis. Por enquanto deve ser atualizado manualmente
                $ind = $marcador;
                while ($vet_dados[$ind] != '')
                {
                    // Disponibiliza na tela os dados adicionais do arquivo de exemplo (informacoes sobre o exmeplo)
                    echo $vet_dados[$ind];
                    echo "<br>";
                    $ind++;
                } // end while
                list($dir1, $dir2, $nome_arquivo) = explode("/", $dado);
                list($nome_arquivo, $extensao) = explode(".", $nome_arquivo);
                echo "<br>";
                if ($nome_arquivo > 1)
                {
                    echo "<a href=".(basename($_SERVER["PHP_SELF"], "2a.php"))."2.php?exemplo=nao&executar=sim&arquivo=bancodados&dado=exemplos/".(basename($_SERVER["PHP_SELF"], "2a.php"))."2/".($nome_arquivo-1)."&idioma=".($idioma).">".(G_MSG_21)."</a>";
                } // end if
                echo "&nbsp&nbsp&nbsp";
                echo "<a href=".(basename($_SERVER["PHP_SELF"], "2a.php"))."2.php?exemplo=sim&arquivo=bancodados&idioma=".($idioma).">".(G_MSG_22)."</a>";
                echo "&nbsp&nbsp&nbsp";
                if ($nome_arquivo < num_exemplos)
                {
                    echo "<a href=".(basename($_SERVER["PHP_SELF"], "2a.php"))."2.php?exemplo=nao&executar=sim&arquivo=bancodados&dado=exemplos/".(basename($_SERVER["PHP_SELF"], "2a.php"))."2/".($nome_arquivo+1)."&idioma=".($idioma).">".(G_MSG_23)."</a>";
                } // end if
                echo "</p>";
            } // end if
            if (isset($_POST["navegacao"]) && $_POST["navegacao"] == "sim")
                {
                echo "<form name=\"exemplos\" enctype=\"multipart/form-data\" method=\"post\">";
                echo "<script language=\"javascript\" type=\"text/javascript\">\n";
                echo "function criarLinks(value) {\n";
                echo "document.exemplos.indice.value = value;\n";
                echo "document.exemplos.action = 'index.php?inc=gauss2.php&modo=exemplo'\n";
                echo "document.exemplos.submit();\n";
                echo "}\n";
                echo "</script>";
                echo "<input type=\"hidden\" name=\"id_bib\" value=\"".$id_bib."\">";
                echo "<input type=\"hidden\" name=\"xml_file\" value=\"".$xml_file."\">";
                echo "<input type=\"hidden\" name=\"indice\">";
                echo $msg->get('Outros_Exemplos')."<br>";
                $objeto = new DOMDocument();
                $objeto->load($xml_file);
                $filho = $objeto->getelementsbytagname("lin_systems");
                if ($filho->length > 0)
                    {
                    $temp = $filho->item(0)->getelementsbytagname("system");
                    $j = 0;
                    for($i = 0; $i < $temp->length; $i++)
                    {
                        $method = $temp->item($i)->getelementsbytagname("method");
                        $conteudo = $method->item(0)->nodeValue;
                        $dime = $temp->item($i)->getelementsbytagname("dim");
                        $dime = $dime->item(0)->nodeValue;
                        if ($conteudo == 'direct')
                            {
                            if ($j != 0) echo " | ";
                            if ($j == $indice) echo "<b>";
                            echo "<a href=\"javascript:criarLinks($j)\" title=\"Dimens&atilde;o $dime\"><u>".($j+1)."</u></a>";
                            if ($j == $indice) echo "</b>";
                            $j++;
                        }
                    }
                }
                echo "</form>";
            }
            echo "<p>";
            echo $msg->get('G_PROXIMO_EXEMPLO');
            echo "</p>";
            
            echo "<form method=post enctype=multipart/form-data action=index.php?inc=cholesky.php>";
            if (isset($_POST["navegacao"]) && $_POST["navegacao"] == "sim")
                {
                echo "<input type=\"hidden\" name=\"xml_file\" value=\"".$xml_file."\">";
                echo "<input type=hidden name=navegacao value=sim>";
                echo "<input type=hidden name=indice value=$indice>";
            }
            echo "<input type=hidden name=dim value=".($dim).">";
            for ($i = 0; $i < $dim; $i++)
            {
                for ($j = 0; $j < $dim; $j++)
                {
                    echo "<input type=hidden name=A[".($i)."][".($j)."] value=".($Atemp[$i][$j]).">";
                } //end for j
                echo "<input type=hidden name=T[".($i)."] value=".($Atemp[$i][$j]).">";
            } //end for i
            if (isset($correcao) && $correcao == "sim")
            {
                echo "<input type=hidden name=correcao value=sim>";
                for ($i = 0; $i < $dim; $i++)
                {
                    echo "<input type=hidden name=vet_resp[".($i)."] value=".($vet_resp[$i]).">";
                } //end fori
            } // end if
            echo "<input class=button type=submit name=Calcular value='".$msg->get('CHOLESKY_MSG_03')."'>";
            echo "</form>";
            
            
            echo "<form method=post enctype=multipart/form-data action=index.php?inc=ludecomp.php>";
            if (isset($_POST["navegacao"]) && $_POST["navegacao"] == "sim")
                {
                echo "<input type=\"hidden\" name=\"xml_file\" value=\"".$xml_file."\">";
                echo "<input type=hidden name=navegacao value=sim>";
                echo "<input type=hidden name=indice value=$indice>";
            }
            echo "<input type=hidden name=dim value=".($dim).">";
            for ($i = 0; $i < $dim; $i++)
            {
                for ($j = 0; $j < $dim; $j++)
                {
                    echo "<input type=hidden name=A[".($i)."][".($j)."] value=".($Atemp[$i][$j]).">";
                } //end for j
                echo "<input type=hidden name=T[".($i)."] value=".($Atemp[$i][$j]).">";
            } //end for i
            if (isset($correcao) && $correcao == "sim")
            {
                echo "<input type=hidden name=correcao value=sim>";
                for ($i = 0; $i < $dim; $i++)
                {
                    echo "<input type=hidden name=vet_resp[".($i)."]  value=".($vet_resp[$i]).">";
                } //end fori
            } // end if
            echo "<input class=button type=submit name=Calcular value='".$msg->get('LUDECOMP_MSG_03')."'>";
            echo "</form>";
            
            
            echo "<form method=post enctype=multipart/form-data action=index.php?inc=gauss1.php>";
            if (isset($_POST["navegacao"]) && $_POST["navegacao"] == "sim")
                {
                echo "<input type=\"hidden\" name=\"xml_file\" value=\"".$xml_file."\">";
                echo "<input type=hidden name=navegacao value=sim>";
                echo "<input type=hidden name=indice value=$indice>";
            }
            echo "<input type=hidden name=dim value=".($dim).">";
            for ($i = 0; $i < $dim; $i++)
            {
                for ($j = 0; $j < $dim; $j++)
                {
                    echo "<input type=hidden name=A[".($i)."][".($j)."] value=".($Atemp[$i][$j]).">";
                } //end for j
                echo "<input type=hidden name=A[".($i)."][".($j)."] value=".($Atemp[$i][$j]).">";
            } //end for i
            if (isset($correcao) && $correcao == "sim")
            {
                echo "<input type=hidden name=correcao value=sim>";
                for ($i = 0; $i < $dim; $i++)
                {
                    echo "<input type=hidden name=vet_resp[".($i)."] value=".($vet_resp[$i]).">";
                } //end fori
            } // end if
            echo "<input class=button type=submit name=Calcular value='".$msg->get('GAUSS_MSG_03a')."'>";
            echo "</form>";
            /*** COMENTARIO PARA PIVOTEAMENTO TOTAL ***/
            /*
            echo "<form method=post enctype=multipart/form-data action=index.php?inc=gauss3.php>";
            if (isset($_POST["navegacao"]) && $_POST["navegacao"] == "sim")
                {
                echo "<input type=\"hidden\" name=\"xml_file\" value=\"".$xml_file."\">";
                echo "<input type=hidden name=navegacao value=sim>";
                echo "<input type=hidden name=indice value=$indice>";
            }
            echo "<input type=hidden name=dim value=".($dim).">";
            for ($i = 0; $i < $dim; $i++)
            {
                for ($j = 0; $j < $dim; $j++)
                {
                    echo "<input type=hidden name=A[".($i)."][".($j)."] value=".($Atemp[$i][$j]).">";
                } //end for j
                echo "<input type=hidden name=A[".($i)."][".($j)."] value=".($Atemp[$i][$j]).">";
            } //end for i
            if (isset($correcao) && $correcao == "sim")
            {
                echo "<input type=hidden name=correcao value=sim>";
                for ($i = 0; $i < $dim; $i++)
                {
                    echo "<input type=hidden name=vet_resp[".($i)."] value=".($vet_resp[$i]).">";
                } //end fori
            } // end if
            echo "<input class=button type=submit name=Calcular value='".(GAUSS_MSG_03c)."'>";
            echo "</form>";*/
        }
    }
?>

</div>